
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
customizable inflections for nodejs
NOTE: 0.3.2 was accidentally unpublished from the server and npm doesn't allow me to publish it back. Please upgrade to 0.3.3
npm install i
Require the module before using
var inflect = require('i')();
All the below api functions can be called directly on a string
inflect.titleize('messages to store') // === 'Messages To Store'
'messages to store'.titleize // === 'Messages To Store'
only if true
is passed while initiating
var inflect = require('i')(true);
inflect.pluralize('person'); // === 'people'
inflect.pluralize('octopus'); // === 'octopi'
inflect.pluralize('Hat'); // === 'Hats'
inflect.singularize('people'); // === 'person'
inflect.singularize('octopi'); // === 'octopus'
inflect.singularize('Hats'); // === 'Hat'
inflect.camelize('message_properties'); // === 'MessageProperties'
inflect.camelize('message_properties', false); // === 'messageProperties'
inflect.underscore('MessageProperties'); // === 'message_properties'
inflect.underscore('messageProperties'); // === 'message_properties'
inflect.humanize('message_id'); // === 'Message'
inflect.dasherize('message_properties'); // === 'message-properties'
inflect.dasherize('Message Properties'); // === 'Message Properties'
inflect.titleize('message_properties'); // === 'Message Properties'
inflect.titleize('message properties to keep'); // === 'Message Properties to Keep'
inflect.demodulize('Message.Bus.Properties'); // === 'Properties'
inflect.tableize('MessageBusProperty'); // === 'message_bus_properties'
inflect.classify('message_bus_properties'); // === 'MessageBusProperty'
inflect.foreign_key('MessageBusProperty'); // === 'message_bus_property_id'
inflect.foreign_key('MessageBusProperty', false); // === 'message_bus_propertyid'
inflect.ordinalize( '1' ); // === '1st'
We can use regexp in any of these custom rules
inflect.inflections.plural('person', 'guys');
inflect.pluralize('person'); // === 'guys'
inflect.singularize('guys'); // === 'guy'
inflect.inflections.singular('guys', 'person')
inflect.singularize('guys'); // === 'person'
inflect.pluralize('person'); // === 'people'
inflect.inflections.irregular('person', 'guys')
inflect.pluralize('person'); // === 'guys'
inflect.singularize('guys'); // === 'person'
inflect.inflections.human(/^(.*)_cnt$/i, '$1_count');
inflect.humanize('jargon_cnt'); // === 'Jargon count'
inflect.inflections.uncountable('oil')
inflect.pluralize('oil'); // === 'oil'
inflect.singularize('oil'); // === 'oil'
Here is a list of Contributors
I accept pull requests and guarantee a reply back within a day
MIT/X11
Report here. Guaranteed reply within a day.
Pavan Kumar Sunkara (pavan.sss1991@gmail.com)
FAQs
custom inflections for nodejs
The npm package i receives a total of 528,581 weekly downloads. As such, i popularity was classified as popular.
We found that i demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.